summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-06-13 20:01:02 +0200
committerGitHub <noreply@github.com>2023-06-13 20:01:02 +0200
commit0644c9d6cbd76b28bb808f87c262b5c28fff035a (patch)
tree8c2d804206fb04931b6e18fdaa9cd47f6b384a19
parentMerge pull request #10747 from liamwhite/arm-interface-decouple (diff)
parentandroid: Fix touch input (diff)
downloadyuzu-0644c9d6cbd76b28bb808f87c262b5c28fff035a.tar
yuzu-0644c9d6cbd76b28bb808f87c262b5c28fff035a.tar.gz
yuzu-0644c9d6cbd76b28bb808f87c262b5c28fff035a.tar.bz2
yuzu-0644c9d6cbd76b28bb808f87c262b5c28fff035a.tar.lz
yuzu-0644c9d6cbd76b28bb808f87c262b5c28fff035a.tar.xz
yuzu-0644c9d6cbd76b28bb808f87c262b5c28fff035a.tar.zst
yuzu-0644c9d6cbd76b28bb808f87c262b5c28fff035a.zip
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt
index c8ef8c1fd..d89a89983 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt
@@ -38,9 +38,11 @@ class FixedRatioSurfaceView @JvmOverloads constructor(
newWidth = width
newHeight = (width / aspectRatio).roundToInt()
}
- setMeasuredDimension(newWidth, newHeight)
+ val left = (width - newWidth) / 2;
+ val top = (height - newHeight) / 2;
+ setLeftTopRightBottom(left, top, left + newWidth, top + newHeight)
} else {
- setMeasuredDimension(width, height)
+ setLeftTopRightBottom(0, 0, width, height)
}
}
}